package com.cloud.product.interceptor;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.stereotype.Component;

import java.util.UUID;

/**
 * packageName com.cloud.product.interceptor
 *
 * @author yanshuanglong
 * @version JDK 8
 * @className TokenResquestInterceptor
 * @date 2025/3/18
 * @description TODO
 */
@Component
public class TokenRequestInterceptor implements RequestInterceptor {
    /**
    * AS2
     * @param template
    * @author yangshuanglong
    * @date 2025/3/18
    * return void
    * @description 请求的拦截器
    */
    @Override
    public void apply(RequestTemplate template) {
        System.out.println("TokenRequestInterceptor: " + template);
        template.header("X-Token", UUID.randomUUID().toString().replace("-",""));
    }
}
